feat(podman): honor OCI image working directories - #2563
Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-2563.docs.buildwithfern.com/openshell |
a7e1ee7 to
a6993fa
Compare
a6993fa to
a746233
Compare
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
a746233 to
2ab6ea3
Compare
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
Label |
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
matthewgrossman
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This PR is project-valid because it implements maintainer-authored, agent-ready issue #2526 and is scoped to the Podman half of the OCI WorkingDir work after #2530 merged.
Head SHA: 2069f04785a9ae0742057684c25f479176e0902e
Base SHA: 490f66f47af4c225fabeb2dc48ea51c67154827c
Merge base SHA: 490f66f47af4c225fabeb2dc48ea51c67154827c
Patch ID: af1aa85fb495511ae397c200658e15602169ca7b
Gator payload: 2
Review mode: initial
Previous reviewed SHA: none
Blocking findings:
GATOR-2069f047-01: Podman workspace-probe startup recovery can remove containers selected only by the forgeableopenshell.workspace-probe=truelabel.
Carried findings:
- None
Non-blocking suggestions:
- None
Docs: Fern docs and architecture guidance were updated for the user-visible compute-driver behavior.
Next state: gator:in-review
| "Bridge network ready" | ||
| ); | ||
|
|
||
| let removed_probes = remove_workspace_probes(&client, config.stop_timeout_secs).await?; |
There was a problem hiding this comment.
gator-agent
Warning - GATOR-2069f047-01
Invariant: Podman workspace-probe recovery must only remove stale containers that OpenShell can identify as its own probes; it must not force-remove every container on the configured Podman socket that carries a public label.
Prerequisite: A local operator, another OpenShell gateway, or any user sharing the configured Podman engine can have a container with the forgeable or accidentally reused label openshell.workspace-probe=true.
Entry point -> sink: Starting or restarting a gateway configured with the Podman driver calls PodmanComputeDriver::new, which reaches remove_workspace_probes; that lists by LABEL_WORKSPACE_PROBE_FILTER and then calls remove_container with forced removal and volume cleanup.
Base -> head: The base tree did not delete Podman containers during startup based on a workspace-probe label. This head removes every container returned for openshell.workspace-probe=true; the probe spec omits the normal openshell.managed ownership label and cleanup does not check name, state, gateway instance, or sandbox ownership.
Impact: A gateway restart can delete an unrelated user container, including its anonymous volumes, or a second gateway can delete another gateway's active validation probe and make a valid sandbox creation fail.
Reproducer: Run podman run -d --name keep-me --label openshell.workspace-probe=true alpine sleep 600, then start an OpenShell gateway using the same Podman socket; startup reaches PodmanComputeDriver::new and issues DELETE for keep-me. A deterministic unit version is a Podman stub returning one ContainerListEntry with that label but no OpenShell ownership marker, and asserting that the constructor must not send DELETE.
PR ownership: This PR introduces the workspace-probe label, startup recovery path, and force-removal call; the base tree had no stale workspace probes to reconcile and no startup deletion selected by this label.
Requested change: Make probe cleanup ownership- and state-constrained: mark actual probe containers with standard OpenShell-managed ownership metadata plus a probe-specific identifier, and have startup recovery remove only stopped/exited OpenShell-owned probe containers that match those constraints. Add tests proving a non-managed container with openshell.workspace-probe=true is preserved and an active probe from another live driver instance is not removed.
Summary
Extend the Docker/shared OCI working-directory support introduced in #2530 to the Podman driver. Podman validates the original immutable image before its workspace volume masks the OCI workdir, then launches the sandbox at the validated path without expanding the image user filesystem authority.
This work was originally developed on top of #2530. That PR has merged, and this PR now targets
main.Related Issue
Part of #2526
Changes
Testing
mise run pre-commitmise run test-D warningsChecklist